package com.gsit.expenditure.utils;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppContextLoader {

	private static ApplicationContext context = null;
	private static final String CONFIG_BASE_PACKAGE = "com.gsit.expenditure.config";
	static{
		context = new AnnotationConfigApplicationContext(CONFIG_BASE_PACKAGE);
	}
	  
	private AppContextLoader(){
		
		
	}
	
	public static <T> T getBean(Class<T> cls) throws BeansException {
		return context.getBean(cls);
	}
	
	
	
	/*FXMLLoader fxmlLoader  = new FXMLLoader();
	   fxmlLoader.load(ViewHandler.class.getResource(""));
	   fxmlLoader.getController();
	*/
}
